package com.it2.controller;


import com.it2.UserService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping("/user")
public class UserController {

//    @Autowired
/**
 * 1.远程注入,从zookeeper注册中兴获取userService的访问url
 * 2.进行远程调用
 * 3.将结果封装为一个代理对象，给变量赋值
 */

    @org.apache.dubbo.config.annotation.Reference
    private UserService userService;//注入service

    @RequestMapping("/sayhello")
    public String sayhello(){
        return userService.hello();
    }
}
